package com.shrct.businessprocess.purchase.impl;

import com.shrct.businessprocess.purchase.PayMethod;
import com.shrct.businessprocess.purchase.proxy.PayMethodProxy;
import edu.fudan.langlab.domain.code.impl.CodeImpl;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@Entity
@DiscriminatorValue("PAYMETHOD_TYPE")
public class PayMethodImpl extends CodeImpl implements PayMethod {
  public PayMethodImpl() {
    super();
  }
  
  public static PayMethod create(final IObjectFactory objectFactory) {
    com.shrct.businessprocess.purchase.PayMethod payMethod = new com.shrct.businessprocess.purchase.impl.PayMethodImpl(
    );
    objectFactory.create(payMethod);
    return payMethod;			
    
  }
  
  public static PayMethod createPayMethodImpl(final IObjectFactory objectFactory, final Procedure1<PayMethod> init) {
    com.shrct.businessprocess.purchase.PayMethod payMethod = new com.shrct.businessprocess.purchase.impl.PayMethodImpl(
    );
    objectFactory.create(payMethod);
    init.apply(payMethod);
    
    return payMethod;			
    
  }
  
  public PayMethodProxy toProxy() {
    com.shrct.businessprocess.purchase.proxy.PayMethodProxy proxy = new com.shrct.businessprocess.purchase.proxy.PayMethodProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
